import scrapy


class ExampleSpider(scrapy.Spider):
    name = 'example'

    # allowed_domains = ['example.com']
    # start_urls = ['http://example.com/']

    def start_requests(self):
        urls = ["https://www.runoob.com/python3/python3-tutorial.html"]
        for url in urls:
            yield scrapy.Request(url=url, callback=self.parse)

    def parse(self, response):
        filename = response.url.split("/")[-1]
        with open(filename, "wb") as f:
            f.write(response.body)
            f.close()

